package com.haixiaoke.saas.apartment.mapper;

import com.haixiaoke.saas.apartment.domain.UnsubscribeRule;

import java.util.List;

/**
 * 退订规则Mapper接口
 *
 * @author panda
 * @date 2024-03-30
 */
public interface UnsubscribeRuleMapper {
    /**
     * 查询退订规则
     *
     * @param unsubscribeRuleId 退订规则主键
     * @return 退订规则
     */
    UnsubscribeRule selectUnsubscribeRuleByUnsubscribeRuleId(Long unsubscribeRuleId);

    /**
     * 查询退订规则列表
     *
     * @param unsubscribeRule 退订规则
     * @return 退订规则集合
     */
    List<UnsubscribeRule> selectUnsubscribeRuleList(UnsubscribeRule unsubscribeRule);

    /**
     * 新增退订规则
     *
     * @param unsubscribeRule 退订规则
     * @return 结果
     */
    int insertUnsubscribeRule(UnsubscribeRule unsubscribeRule);

    /**
     * 修改退订规则
     *
     * @param unsubscribeRule 退订规则
     * @return 结果
     */
    int updateUnsubscribeRule(UnsubscribeRule unsubscribeRule);

    /**
     * 删除退订规则
     *
     * @param unsubscribeRuleId 退订规则主键
     * @return 结果
     */
    int deleteUnsubscribeRuleByUnsubscribeRuleId(Long unsubscribeRuleId);

    /**
     * 批量删除退订规则
     *
     * @param unsubscribeRuleIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteUnsubscribeRuleByUnsubscribeRuleIds(Long[] unsubscribeRuleIds);

    /**
     * 校验退订名称是否重复
     * @param unsubscribeRule
     * @return
     */
    int checkRuleName(UnsubscribeRule unsubscribeRule);

    /**
     * 校验退订规则是否关联房间
     * @param unsubscribeRuleId
     * @return
     */
    int checkAllocationByRule(Long unsubscribeRuleId);
}
